package com.zc.client.http.form;


/**
 * 登录表单
 *
 * @author wzy
 * @Date 2025/8/28 14:45
 */

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.zc.client.http.ParaForm;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

/**
 *
 * @author wzy
 */
@Getter
@Setter
public class LoginFrom implements ParaForm {

    /** 验证码 */
    private String code = "1234";
    /** 验证码 */
    private String deviceId = "";
    /** 验证码 */
    private String gioUid = "";
    /** 验证码 */
    private String inviteCode = "";
    /** 验证码 */
    private String loginSourceType;
    /** 手机号 */
    private String mobile;
    /** 节目Id 我感觉不用啊 */
    private Integer programId;
    /** 验证码 */
    private String verifyType;

    public LoginFrom() {
    }

    public LoginFrom(Builder builder) {
        this.code = builder.code;
        this.deviceId = "";
        this.gioUid = "";
        this.inviteCode = "";
        this.loginSourceType = null;
        this.mobile = builder.mobile;
        this.programId = builder.programId;
        this.verifyType = null;
    }

    @Override
    public String generateJSONStr() {
        return JSONUtil.toJsonStr(ObjectUtil.isNotNull(this) ? this : "");
    }

    public static class Builder{
        /** 验证码 */
        private String code = "1234";
        /** 验证码 */
        private String deviceId;
        /** 验证码 */
        private String gioUid;
        /** 验证码 */
        private String inviteCode;
        /** 验证码 */
        private String loginSourceType;
        /** 手机号 */
        private String mobile;
        /** 节目Id 我感觉不用啊 */
        private Integer programId;
        /** 验证码 */
        private String verifyType;

        public Builder() {
        }

        public Builder mobile(String mobile){
            this.mobile = mobile;
            return this;
        }

        public Builder code(String code){
            this.code = code;
            return this;
        }

        public Builder programId(String programId){
            this.code = code;
            return this;
        }

        public LoginFrom build(){
            return new  LoginFrom(this);
        }

    }
}
